package cn.jtcoding.xhs.service.impl;

import cn.jtcoding.xhs.dao.TopicDao;
import cn.jtcoding.xhs.model.convert.TopicConvert;
import cn.jtcoding.xhs.model.dataobject.TopicDO;
import cn.jtcoding.xhs.model.vo.TopicVO;
import cn.jtcoding.xhs.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author jason.tang
 * @Date 2020/8/5 12:39
 * @Desc
 */

@Service
public class TopicServiceImpl implements TopicService {

    @Autowired
    private TopicDao topicDao;

    @Override
    public List<TopicVO> getTopicList() {
        List<TopicDO> topicDOs = topicDao.getTopicList();
        return TopicConvert.INSTANCE.topicsToVO(topicDOs);
    }
}
